﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/static/include/top.jsp"%>
<script>document.title="企业列表";</script>
<script src="${baseURL}/static/js/calendar.js"></script>
<script type="text/javascript">

function openEditWin(url,tit){
	openWin(tit,url,1000,500);
}

function openViewWin(id){
	openWin("审批历史","view?id="+id,800,600);
}
function xxx(){
	location.reload(true);
}
</script>

<table>
		<tbody>
			<tr>
				<th><img src="${ctx}/static/images/pages/cen/rig/ico_01.png" align="absmiddle">&nbsp;已提交上级报表</th>
			</tr>
			<tr class="tab_grey">
				<td>
				<form name="searchForm" action="" method="get">
			<input type="hidden" name="p" value="1" />
			<input type="hidden" name="flag" value="1" />
			报表制度:
		<select id="typeId" name="typeId" onchange="getVersion($('#typeId').val());"  class="tab_textbut" >
			<option value="">请选择..</option>
			<c:forEach var="sys" items="${sysList}">
                   <option value="${sys.code}">${sys.codeName}</option>
               </c:forEach>
		</select>
		
		<span class="tab_text">报表版本:</span>
		<select id="versionId" name="versionId" onchange="getRep($('#typeId').val(),$('#versionId').val());"  class="tab_textbut" >
			<option value="">请选择..</option>
			<c:forEach var="vs" items="${vsList}">
                   <option value="${vs.id}">${vs.versionSystem}</option>
               </c:forEach>
		</select>
		
		<span class="tab_text">填报报表:</span>
			<select id="reportTypeId" name="reportTypeId"  class="tab_textbut" >
           </select>
		
			<span class="tab_text">录入年份:</span>
			<select id="createYear" name="createYear"  class="tab_textbut" >
               <option value="">请选择..</option>
               <c:forEach var="year" items="${yearList}">
                   <option value="${year}">${year}</option>
               </c:forEach>
           </select>
           
           	<span class="tab_text">开始时间:</span>
			<input
				id="searchDate" name="searchDate" onclick="calendar.show(this);"
				value="${formdata.startTime}" type="text"  class="tab_textbut" >
			<span class="tab_text">结束时间：</span>
			
			<input
				id="endDate" name="endDate" onclick="calendar.show(this);"
				value="${formdata.endTime}" type="text"  class="tab_textbut" >
			
			
			<a class="tab_but" href="#" onclick="searchForm.action='${baseURL}/data/submitList';searchForm.submit();return false;">查询</a>
			<a class="tab_but" href="#" onclick="clearInput();return false;">清空</a>
			
			
		</form>
		
			
		<script>
		$("#reportTypeId").val("${param['roleId']}");
		$("#createYear").val("${param['createYear']}");
		$("#typeId").val("${param['typeId']}");
		$("#versionId").val("${param['versionId']}");
		$("#searchDate").val("${param['searchDate']}");
		$("#endDate").val("${param['endDate']}");
		
		
		
		function clearInput() {
			$("#reportTypeId").val("");;
			$("#createYear").val("");
			$("#typeId").val("");
			$("#versionId").val("");
			$("#searchDate").val("");
			$("#endDate").val("");
		
		}
		</script>
		<iframe name="upload" width="0" height="0" frameborder="0"></iframe>
				
				</td>
			</tr>
		</tbody>
	</table>

 
  <br />
	<c:if test="${empty obj.operationResult}">
		<b>没有符合条件的记录。</b>
	</c:if>
<c:if test="${not empty obj.operationResult}">
  <table id="listTable">
  <tbody>
    <tr>
    	
        <th width="20%">数据报表</th>
		<th width="8%">频率</th>
		<th width="8%">频率时段</th>
		<th width="14%">报出时间</th>
		<th width="20%">报表单位</th>
		<th width="10%">填表人</th>
		<th width="10%">审批历史</th>
		<th>操作</th>
    </tr>
    <c:forEach var="oneRow" items="${obj.operationResult}">
    		
    <tr>
    	
      	<td align="left">${oneRow.reportName}</td>
		<td align="left">${oneRow.reportTimetype}</td>
		<td align="left">${oneRow.reportYear}</td>
		<td align="left">${oneRow.reportDate}</td>
		<td align="left">${oneRow.reportUnit}</td>
		<td align="left">${oneRow.reportFillAdmin}</td>
		<td align="left">
			<a href="#" onclick="openViewWin('${oneRow.id}')"><img src="${baseURL}/static/images/tab/ico_01.png" width="16" height="16" border="0" align="absmiddle"/>历史</a></td>
		<td align="left">
			<a href="#" onclick="openEditWin('http://localhost:8080/jsme-das-lan/reports/service.do?method=showReportInfo&reportOperatorId='+'${reportProxyId}'+'&reportId='+'${oneRow.id}','查看'+'${oneRow.reportDomainName}')"><img src="${baseURL}/static/images/tab/ico_01.png" width="16" height="16" border="0" align="absmiddle"/>详情</a>
			
		</td>
    </tr>
    </c:forEach>
   
       <tr class="tab_grey">
				<td colspan="9" align="center" valign="middle" class="tab_white">
				<div class="pagination"> 
					<%@ include file="../include/listpage.jsp"%>
				</div>
				<div class="clear"></div>
				</td>
			</tr>
			</tbody>
  </table>
<script>

function selectAll(checkAllFlag) {
	var checkArray = document.getElementsByName("chk");
	for (var i = 0; i < checkArray.length; i++) {
		checkArray[i].checked = checkAllFlag;
	}
}

function getRep(ptype,versionId) {
	
	$.getJSON("${baseURL}/data/getReps?versionId="+versionId+"&typeId="+ptype, function(data) {
		$("#reportTypeId").empty();
		$("#reportTypeId").append( "<option value='0'>请选择..</option>" );
		
	 	$.each(data, function(i, item) {
            $("#reportTypeId").append( "<option value='" + item.id + "'>" + item.typeName + "</option>" );
        });
 });
}
	
	function getVersion(ptype) {
	
		$.getJSON("${baseURL}/data/changeSys?typeId="+ptype, function(data) {
			$("#versionId").empty();
			$("#versionId").append( "<option value='0'>请选择..</option>" );
			
		 	$.each(data, function(i, item) {
	            $("#versionId").append( "<option value='" + item.id + "'>" + item.versionSystem + "</option>" );
	        });
	 });
	}



</script>
</c:if>

<%@ include file="/static/include/bottom.jsp"%>
